package com.hry.store.pojo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

public class CartItem {
    /** 主键id */
    private Integer id;

    /** 用户邮箱 */
    private String userEmail;

    /** 产品id */
    private Integer productId;

    /** 产品名称 */
    private String productName;

    /** 商品数量 */
    private Integer quantity;

    /** 商品单价 */
    private BigDecimal productPrice;

    /** 商品总价 */
    private BigDecimal productTotalPrice;

    /** 版本id */
    private Integer versionId;

    /** 颜色名称 */
    private String colorName;

    /** 图片地址 */
    private String productImg;

    /**  */
    private Integer checked;

    /** 创建时间 */
    private Date createTime;

    /** 更新时间 */
    private Date updateTime;



    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CartItem cartItem = (CartItem) o;
        return Objects.equals(userEmail, cartItem.userEmail) &&
                Objects.equals(productId, cartItem.productId) &&
                Objects.equals(productName, cartItem.productName) &&
                Objects.equals(productPrice, cartItem.productPrice) &&
                Objects.equals(versionId, cartItem.versionId) &&
                Objects.equals(colorName, cartItem.colorName);
    }

    @Override
    public int hashCode() {

        return Objects.hash(userEmail, productId, productName, productPrice, versionId, colorName);
    }

    public CartItem(Integer id, String userEmail, Integer productId, String productName, Integer quantity, BigDecimal productPrice, BigDecimal productTotalPrice, Integer versionId, String colorName, String productImg, Integer checked, Date createTime, Date updateTime) {
        this.id = id;
        this.userEmail = userEmail;
        this.productId = productId;
        this.productName = productName;
        this.quantity = quantity;
        this.productPrice = productPrice;
        this.productTotalPrice = productTotalPrice;
        this.versionId = versionId;
        this.colorName = colorName;
        this.productImg = productImg;
        this.checked = checked;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

    public CartItem() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail == null ? null : userEmail.trim();
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName == null ? null : productName.trim();
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public BigDecimal getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(BigDecimal productPrice) {
        this.productPrice = productPrice;
    }

    public BigDecimal getProductTotalPrice() {
        return productTotalPrice;
    }

    public void setProductTotalPrice(BigDecimal productTotalPrice) {
        this.productTotalPrice = productTotalPrice;
    }

    public Integer getVersionId() {
        return versionId;
    }

    public void setVersionId(Integer versionId) {
        this.versionId = versionId;
    }

    public String getColorName() {
        return colorName;
    }

    public void setColorName(String colorName) {
        this.colorName = colorName == null ? null : colorName.trim();
    }

    public String getProductImg() {
        return productImg;
    }

    public void setProductImg(String productImg) {
        this.productImg = productImg == null ? null : productImg.trim();
    }

    public Integer getChecked() {
        return checked;
    }

    public void setChecked(Integer checked) {
        this.checked = checked;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}